import time, os, random

def ChosShop(save, map: str, money: int, discount_num: list, player_warehouse_list: list, player_warehouse_list_name: list, warehouse_level: int, original_price: list): # 进货的主函数
    '''
    map 地图数，用于选择地区;\n
    money 钱数，玩家有的钱;\n
    discount_num 折扣数，用于指明哪个超市打折;\n
    player_warehouse_list 仓库货物，玩家当前仓库里有什么东西;\n
    player_warehouse_list_name 仓库货物名字，玩家仓库里面的东西;\n
    warehouse_level 仓库等级，仓库的等级，决定玩家仓库和营业能持有的货物种类总数和单位总数;\n
    original_price 原价列表，储存玩家购买的商品单价原价
    '''
    # 初始化
# ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
    all_maps = {'A': Map1, 'B': Map2, 'C': Map3, 'D': Map4, 'E': Map5} # 记录地图
    shops = {1: {'A': Shop1, 'B': Shop3, 'C': Shop5, 'D': Shop7, 'E': Shop9},
             2: {'A': Shop2, 'B': Shop4, 'C': Shop6, 'D': Shop8, 'E': Shop10}} # 记录商店，二维字典
    manifest_list = [] # 重置进货商品信息列表
    manifest_price = 0 # 重置进货总价
    manifest_item_price = [] # 重置单商品总价
    manifest_item_name = [] # 重置商品名字列表
    player_manifest = [] # 重置即将要添加进玩家仓库的进货单
    manifest_count = [] # 重置单商品的单位量
    manifest_original = [] # 单价列表
    manifest_original_price = [] # 重置单商品单价
# ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
    os.system ('cls')
    while (True):
        try:
            print ("\033[39;33m|---------------------------------------")
            print (f"\033[39;33m|\033[0m持有\033[1;33m{money}\033[0m₿")
            all_maps[map] ()
            print ("\033[39;33m|---------------------------------------")
            print ("\033[39;33m|\033[38;5;23m3. 操作和查看当前进货清单")
            print ("\033[39;33m|\033[38;5;42m4. 确认进货")
            print ("\033[39;33m|\033[39;31m0. 退出进货")
            print ("\033[39;33m|---------------------------------------\033[0m")
            player_shop = int (input ("输入需要的功能："))
            if (player_shop in [1, 2]):
                os.system ('cls')
                try :
                    # manifest_cost, 商品单价格表；manifest_name, 商品名字表；manifest_unit，商品单位表
                    manifest_cost, manifest_name, manifest_unit, manifest_original = shops[player_shop][map] (discount_num) # 输出玩家所选市场的商品单
                    print ("\033[1;31m输入其他任意内容取消当前进货内容\n")
                    buy = int (input ("\033[39;34m输入你要进货的商品序号：\033[0m"))
                    if (buy < 1 or buy > 10):
                        raise ValueError
                    elif (manifest_name[buy] not in manifest_item_name) : # 判断玩家买的物品是否已在进货订单中
                        os.system ('cls')
                        print (f"\033[39;34m当前进货：\033[39;32m{manifest_name[buy]} {manifest_cost[buy]}₿/{manifest_unit[buy]}") #  提示玩家现在所选进货内容
                        print (f"\033[39;31m进货量不得低于1{manifest_unit[buy]}，且必须为整数")
                        print ("\033[1;31m输入其他任意内容取消当前进货内容\n")
                        print (f"\033[39;34m你要进货多少{manifest_unit[buy]}：\033[0m", end = '') # 玩家输入进货量(小数向下取整)
                        buy_amount = int (input ())
                        if (buy_amount < 1):
                            raise ValueError
                        os.system ('cls')
                        print (f"\n\033[39;33m已成功将\033[39;32m{manifest_name[buy]} {buy_amount}{manifest_unit[buy]} {manifest_cost[buy] * buy_amount}₿ \033[39;33m添加至进货清单\033[0m\n")
                        manifest_list.append ([manifest_name[buy], f"{buy_amount}{manifest_unit[buy]}", f"{manifest_cost[buy] * buy_amount}₿"]) # 分别将玩家所进货的商品/总量/总价添加入总进货列表
                        manifest_item_price.append (manifest_cost[buy] * buy_amount) # 将进货商品总价计入总进货总价表(记录)
                        manifest_item_name.append (manifest_name[buy]) # 将进货商品名字计入总进货名字表
                        player_manifest.append ([manifest_name[buy], buy_amount, manifest_unit[buy]]) # 将本次添加的商品计入即将加入玩家仓库的表单中
                        manifest_price += manifest_cost[buy] * buy_amount # 将本次添加的商品总价加入进货总价(计算)
                        manifest_original_price.append (manifest_original[buy])
                        manifest_count.append (buy_amount)
                    else :
                        os.system ('cls')
                        print ("\n\033[1;31m该商品已在进货列表当中！\n如果需要修改数量请先删除后再添加！\033[0m\n")
                except ValueError:
                    os.system ('cls')
                    print ("\n\033[1;31m取消当前进货内容\033[0m\n")
            elif (player_shop == 3):
                if (len (manifest_list) > 0): # 判断总进货列表是否有内容
                    os.system ('cls')
                    # 调用查看总进货列表函数
                    manifest_list, manifest_price, manifest_item_price, manifest_item_name, manifest_count, player_manifest, manifest_original_price = Manifest (manifest_list, manifest_price, manifest_item_price, manifest_item_name, manifest_count, player_manifest, manifest_original_price)
                else :
                    os.system ('cls')
                    print ("\033[1;31m暂无进货内容。\033[0m\n")
            elif (player_shop == 4):
                os.system ('cls')
                if (len (manifest_list) > 0): # 判断总进货列表是否有内容
                    print ("\033[39;33m|---------------------------------------")
                    print ("\033[39;33m|\033[1;35m当前进货列表")
                    num = 1
                    list_name_acount = 0 # 重置进货种量
                    for i in manifest_list:
                        print (f"\033[39;33m|\033[39;35m{num}. \033[39;32m{' '.join(str (x) for x in i)}") # 输出总进货列表的每一项信息
                        num += 1
                        if (i[0] in player_warehouse_list_name): # 如果这个货物在原本的玩家仓库里
                            pass # 跳过什么都不加
                        else :
                            list_name_acount += 1 # 如果不在则进货种量加1
                    list_amount = 0 # 重置玩家原仓库单位数量
                    for i in player_warehouse_list:
                        list_amount += i[1] # 计算玩家原仓库单位数量
                    manifest_amount = 0 # 重置进货单位数量
                    for i in manifest_count:
                        manifest_amount += i # 计算进货单位数量总量
                    print ("\033[39;33m|---------------------------------------")
                    print (f"\033[39;33m|\033[39;31m共计\033[39;36m{list_name_acount}\033[39;32m种商品")
                    print (f"\033[39;33m|\033[39;31m共计\033[39;36m{manifest_amount}\033[39;32m单位商品")
                    print (f"\033[39;33m|\033[39;31m共计\033[39;33m{manifest_price}\033[39;31m₿")
                    print (f"\033[39;33m|\033[39;31m结算后剩余\033[39;33m{money - manifest_price}\033[39;31m₿")
                    print (f"\033[39;33m|\033[39;31m结算后仓库还可存放\033[39;32m{(warehouse_level * 5) - (list_name_acount + len (player_warehouse_list_name))}\033[39;31m种商品")
                    print (f"\033[39;33m|\033[39;31m结算后仓库还可存放\033[39;32m{(warehouse_level * 30) - (manifest_amount + list_amount)}\033[39;31m单位商品")
                    print ("\033[39;33m|---------------------------------------\033[0m")
                    if (((money - manifest_price) >= 0) and # 玩家的钱够执行是否确认进货
                        ((manifest_amount + list_amount) <= (warehouse_level * 30)) and # 仓库里的物品种量和进货种量相加是否大于仓库可存放种量
                        ((list_name_acount + len (player_warehouse_list_name)) <= (warehouse_level * 5))): # 仓库里的物品单位数量和进货物品单位数量相加是否大于仓库可存放物品单位数量
                        print ("\033[39;31m输入Yes以确认进货(区分大小写)")
                        chos = input ("\033[39;34m是否确认进货：\033[0m")
                        if (chos == 'Yes'):
                            for x in range (len (player_manifest)): # 计算即将添入玩家列表的数量
                                if (player_manifest[0][0] in player_warehouse_list_name): # 如果第一项在原仓库里
                                    local = player_warehouse_list_name.index (player_manifest[0][0]) # 定位到这个货物在原仓库的位置
                                    player_warehouse_list[local][1] += player_manifest[0][1] # 将进货的数量添加到原仓库里
                                else :
                                    player_warehouse_list.append (player_manifest[0]) # 不在的话就添加到原仓库末尾
                                    player_warehouse_list_name.append (player_manifest[0][0]) # 名字也添加进去
                                    original_price.append (manifest_original_price[0])
                                del player_manifest[0], manifest_original_price[0] # 删除第一项
                            money -= manifest_price # 扣款
                            os.system ('cls')
                            save = 0
                            return save, player_warehouse_list, player_warehouse_list_name, money, original_price # 返回玩家的仓库列表和钱
                        else :
                            os.system ('cls')
                            print ("\033[1;31m取消确认进货！\033[0m\n")
                    elif (((manifest_amount + list_amount) > (warehouse_level * 30)) or
                        ((list_name_acount + len (player_warehouse_list_name)) > (warehouse_level * 5))):
                        print (f"\033[39;31m进货超出了仓库可存放空间，塞不下啦！\033[0m") # 玩家钱不够就输出这个
                        input ("\n按Enter返回...")
                        os.system ('cls')
                    else :
                        print (f"\033[39;31m你还差\033[39;33m{manifest_price - money}\033[39;31m₿才能买下全部货物！\033[0m") # 玩家钱不够就输出这个
                        input ("\n按Enter返回...")
                        os.system ('cls')
                else :
                    print ("\033[1;31m暂无进货内容。\033[0m\n")
            elif (player_shop == 0):
                if (len (manifest_list) > 0): # 判断总进货列表是否有内容
                    os.system ('cls')
                    print ("\033[39;31m进货列表清单仍有未付款商品。\n退出会导致清单被清理！")
                    print ("输入Yes以确认退出(区分大小写)")
                    chos = input ("\033[39;34m是否确认退出进货：\033[0m")
                    if (chos == 'Yes'):
                        os.system ('cls')
                        return save, player_warehouse_list, player_warehouse_list_name, money, original_price
                    else :
                        os.system ('cls')
                        print ("\033[1;31m\n取消退出\033[0m\n")
                else : # 总进货列表没有直接返回
                    os.system ('cls')
                    return save, player_warehouse_list, player_warehouse_list_name, money, original_price
            else:
                raise ValueError
        except ValueError:
            os.system ('cls')
            print ("\033[1;31m无效选项！\033[0m\n")
# ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
def Manifest (manifest_list, manifest_price, manifest_item_price, manifest_item_name, manifest_count, player_manifest, manifest_original_price): # 总清单查询函数
    while (True):
        manifest_amount = 0 # 重置进货单位数量
        for i in manifest_count:
            manifest_amount += i # 计算进货单位数量总量
        print ("\033[39;33m|---------------------------------------")
        print ("\033[39;33m|\033[39;35m当前进货列表")
        num = 1
        for i in manifest_list:
            print (f"\033[39;33m|\033[39;35m{num}. \033[39;32m{' '.join(str (x) for x in i)}") # 输出总清单全部信息
            num += 1
        print ("\033[39;33m|---------------------------------------")
        print (f"\033[39;33m|\033[39;31m共计\033[39;33m{manifest_price}\033[39;31m₿")
        print (f"\033[39;33m|\033[39;31m共计\033[39;32m{len (manifest_list)}种商品\033[39;31m")
        print (f"\033[39;33m|\033[39;31m共计\033[39;32m{manifest_amount}单位商品\033[39;31m")
        print ("\033[39;33m|---------------------------------------")
        print ("\033[39;33m|\033[39;31m0. 返回")
        print ("\033[39;33m|\033[39;36m输入进货列表对应序号删除进货内容")
        print ("\033[39;33m|---------------------------------------\033[0m")
        try :
            delete = int (input ("输入需要的功能："))
            if (delete == 0):
                os.system ('cls')
                return manifest_list, manifest_price, manifest_item_price, manifest_item_name, manifest_count, player_manifest, manifest_original_price # 返回所需列表值
            elif (delete in range (num)):
                os.system ('cls')
                print (f"\033[39;31m已将 {' '.join(str (x) for x in manifest_list[delete - 1])} \033[39;31m移除进货清单\033[0m\n") # 将玩家所选商品移除
                manifest_price -= manifest_item_price[delete - 1] # 从总价中减去
                manifest_amount -= manifest_count[delete - 1] # 从总单位数量中减去
                del manifest_list[delete - 1], manifest_item_price[delete - 1], manifest_item_name[delete - 1], manifest_count[delete - 1], player_manifest[delete - 1], manifest_original_price[delete - 1] # 从必要的列表中移除对应元素
        except ValueError:
            os.system ('cls')
            print ("\033[1;31m无效选项！\033[0m\n")   
# ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
def Map1 (): # A
    print ("\033[39;33m|---------------------------------------")
    print ("\033[39;33m|\033[38;5;99m1. 五姨菜市场")
    print ("\033[39;33m|\033[38;5;99m2. 二狗肉市")
    return 'A'
# ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————  
def Map2 (): # B
    print ("\033[39;33m|---------------------------------------")
    print ("\033[39;33m|\033[38;5;99m1. 三叔五金行")
    print ("\033[39;33m|\033[38;5;99m2. 四姐药铺")
    return 'B'
# ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
def Map3 (): # C
    print ("\033[39;33m|---------------------------------------")
    print ("\033[39;33m|\033[38;5;99m1. 六兄布行")
    print ("\033[39;33m|\033[38;5;99m2. 大舅家具城")
    return 'C'
# ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
def Map4 (): # D
    print ("\033[39;33m|---------------------------------------")
    print ("\033[39;33m|\033[38;5;99m1. 十子杂货铺")
    print ("\033[39;33m|\033[38;5;99m2. 八婶水果店")
    return 'D'
# ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
def Map5 (): # E
    print ("\033[39;33m|---------------------------------------")
    print ("\033[39;33m|\033[38;5;99m1. 七哥电子城")
    print ("\033[39;33m|\033[38;5;99m2. 四叔建材坊")
    return 'E'
# ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
def Shop1 (discount_num):
    if (1 in discount_num): # 打折号是否满足
        discount = {1: 2, 2: 2, 3: 2, 4: 2, 5: 3, 
                    6: 3, 7: 3, 8: 3, 9: 4, 10: 4} # 打折价
        print ("折扣日！")
    else :
        discount = {1: 4, 2: 4, 3: 4, 4: 4, 5: 5, 
                    6: 5, 7: 5, 8: 5, 9: 6, 10: 6} # 原价
    print ("\033[39;33m|---------------------------------------")
    print (f"|\033[38;5;51m1. \033[39;32m菠菜  \033[38;5;212m{discount[1]}\033[0m₿/斤\033[39;33m")
    print (f"|\033[38;5;51m2. \033[39;32m茼蒿  \033[38;5;212m{discount[2]}\033[0m₿/斤\033[39;33m")
    print (f"|\033[38;5;51m3. \033[39;32m油菜  \033[38;5;212m{discount[3]}\033[0m₿/斤\033[39;33m")
    print (f"|\033[38;5;51m4. \033[39;32m生菜  \033[38;5;212m{discount[4]}\033[0m₿/斤\033[39;33m")
    print (f"|\033[38;5;51m5. \033[39;32m大蒜  \033[38;5;212m{discount[5]}\033[0m₿/斤\033[39;33m")
    print (f"|\033[38;5;51m6. \033[39;32m大葱  \033[38;5;212m{discount[6]}\033[0m₿/斤\033[39;33m")
    print (f"|\033[38;5;51m7. \033[39;32m番茄  \033[38;5;212m{discount[7]}\033[0m₿/斤\033[39;33m")
    print (f"|\033[38;5;51m8. \033[39;32m土豆  \033[38;5;212m{discount[8]}\033[0m₿/斤\033[39;33m")
    print (f"|\033[38;5;51m9. \033[39;32m黄瓜  \033[38;5;212m{discount[9]}\033[0m₿/斤\033[39;33m")
    print (f"|\033[38;5;51m10. \033[39;32m洋葱  \033[38;5;212m{discount[10]}\033[0m₿/斤\033[39;33m")
    print ("|---------------------------------------\033[0m")
    return discount, {
            1: '菠菜', 2: '茼蒿', 3: '油菜', 4: '生菜', 5: '大蒜',
            6: '大葱', 7: '番茄', 8: '土豆', 9: '黄瓜', 10: '洋葱'}, {
            1: '斤', 2: '斤', 3: '斤', 4: '斤', 5: '斤', 
            6: '斤', 7: '斤', 8: '斤', 9: '斤', 10: '斤'}, {
            1: 4, 2: 4, 3: 4, 4: 4, 5: 5, 
            6: 5, 7: 5, 8: 5, 9: 6, 10: 6}
# ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
def Shop2 (discount_num):
    if (2 in discount_num):
        discount = {1: 3, 2: 5, 3: 5, 4: 10, 5: 12, 
                    6: 15, 7: 28, 8: 40, 9: 75, 10: 100}
        print ("折扣日！")
    else :
        discount = {1: 8, 2: 9, 3: 10, 4: 15, 5: 18, 
                    6: 20, 7: 35, 8: 50, 9: 90, 10: 120}
    print("\033[39;33m|---------------------------------------")
    print(f"|\033[38;5;51m1. \033[39;31m鸡肉  \033[38;5;212m{discount[1]}\033[0m₿/斤\033[39;33m")
    print(f"|\033[38;5;51m2. \033[39;31m鸭肉  \033[38;5;212m{discount[2]}\033[0m₿/斤\033[39;33m")
    print(f"|\033[38;5;51m3. \033[39;31m猪肉  \033[38;5;212m{discount[3]}\033[0m₿/斤\033[39;33m")
    print(f"|\033[38;5;51m4. \033[39;31m羊肉  \033[38;5;212m{discount[4]}\033[0m₿/斤\033[39;33m")
    print(f"|\033[38;5;51m5. \033[39;31m牛肉  \033[38;5;212m{discount[5]}\033[0m₿/斤\033[39;33m")
    print(f"|\033[38;5;51m6. \033[39;34m鲫鱼  \033[38;5;212m{discount[6]}\033[0m₿/斤\033[39;33m")
    print(f"|\033[38;5;51m7. \033[39;34m河虾  \033[38;5;212m{discount[7]}\033[0m₿/斤\033[39;33m")
    print(f"|\033[38;5;51m8. \033[39;34m河蟹  \033[38;5;212m{discount[8]}\033[0m₿/斤\033[39;33m")
    print(f"|\033[38;5;51m9. \033[39;34m鲍鱼  \033[38;5;212m{discount[9]}\033[0m₿/斤\033[39;33m")
    print(f"|\033[38;5;51m10. \033[39;34m龙虾  \033[38;5;212m{discount[10]}\033[0m₿/斤\033[39;33m")
    print("|---------------------------------------\033[0m")
    return discount, {
            1: '鸡肉', 2: '鸭肉', 3: '猪肉', 4: '羊肉', 5: '牛肉',
            6: '鲫鱼', 7: '河虾', 8: '河蟹', 9: '鲍鱼', 10: '龙虾'}, {
            1: '斤', 2: '斤', 3: '斤', 4: '斤', 5: '斤', 
            6: '斤', 7: '斤', 8: '斤', 9: '斤', 10: '斤'}, {
            1: 8, 2: 9, 3: 10, 4: 15, 5: 18, 
            6: 20, 7: 35, 8: 50, 9: 90, 10: 120}
# ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
def Shop3 (discount_num):
    if (3 in discount_num):
        discount = {1: 3, 2: 3, 3: 5, 4: 10, 5: 10, 
                    6: 20, 7: 50, 8: 55, 9: 80, 10: 158}
        print ("折扣日！")
    else :
        discount = {1: 6, 2: 6, 3: 8, 4: 13, 5: 13, 
                    6: 30, 7: 60, 8: 70, 9: 100, 10: 188}
    print("\033[39;33m|---------------------------------------")
    print(f"|\033[38;5;51m1. \033[39;31m5号螺帽  \033[38;5;212m{discount[1]}\033[0m₿/包\033[39;33m")
    print(f"|\033[38;5;51m2. \033[39;31m5号螺丝  \033[38;5;212m{discount[2]}\033[0m₿/包\033[39;33m")
    print(f"|\033[38;5;51m3. \033[39;31m电池  \033[38;5;212m{discount[3]}\033[0m₿/个\033[39;33m")
    print(f"|\033[38;5;51m4. \033[39;31m十字螺丝刀  \033[38;5;212m{discount[4]}\033[0m₿/个\033[39;33m")
    print(f"|\033[38;5;51m5. \033[39;31m一字螺丝刀  \033[38;5;212m{discount[5]}\033[0m₿/个\033[39;33m")
    print(f"|\033[38;5;51m6. \033[39;31m扳手  \033[38;5;212m{discount[6]}\033[0m₿/个\033[39;33m")
    print(f"|\033[38;5;51m7. \033[39;31m锤子  \033[38;5;212m{discount[7]}\033[0m₿/个\033[39;33m")
    print(f"|\033[38;5;51m8. \033[39;34m电子秤  \033[38;5;212m{discount[8]}\033[0m₿/个\033[39;33m")
    print(f"|\033[38;5;51m9. \033[39;34m电钻  \033[38;5;212m{discount[9]}\033[0m₿/个\033[39;33m")
    print(f"|\033[38;5;51m10. \033[39;34m全能工具箱  \033[38;5;212m{discount[10]}\033[0m₿/箱\033[39;33m")
    print("|---------------------------------------\033[0m")
    return discount, {
            1: '5号螺帽', 2: '5号螺丝', 3: '电池', 4: '十字螺丝刀', 5: '一字螺丝刀',
            6: '扳手', 7: '锤子', 8: '电子秤', 9: '电钻', 10: '全能工具箱'}, {
            1: '包', 2: '包', 3: '个', 4: '个', 5: '个', 
            6: '个', 7: '个', 8: '个', 9: '个', 10: '箱'}, {
            1: 6, 2: 6, 3: 8, 4: 13, 5: 13, 
            6: 30, 7: 60, 8: 70, 9: 100, 10: 188}
# ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
def Shop4 (discount_num):
    if (4 in discount_num):
        discount = {1: 1, 2: 5, 3: 9, 4: 10, 5: 10, 
                    6: 15, 7: 15, 8: 20, 9: 25, 10: 48}
        print ("折扣日！")
    else :
        discount = {1: 2, 2: 7, 3: 12, 4: 15, 5: 15, 
                    6: 20, 7: 22, 8: 30, 9: 40, 10: 78}
    print ("\033[39;33m|---------------------------------------")
    print (f"|\033[38;5;51m1. \033[38;5;125mOK绷  \033[38;5;212m{discount[1]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m2. \033[38;5;125m绷带  \033[38;5;212m{discount[2]}\033[0m₿/卷\033[39;33m")
    print (f"|\033[38;5;51m3. \033[38;5;198m碘液  \033[38;5;212m{discount[3]}\033[0m₿/瓶\033[39;33m")
    print (f"|\033[38;5;51m4. \033[38;5;198m75%酒精  \033[38;5;212m{discount[4]}\033[0m₿/瓶\033[39;33m")
    print (f"|\033[38;5;51m5. \033[38;5;168m333感冒灵  \033[38;5;212m{discount[5]}\033[0m₿/盒\033[39;33m")
    print (f"|\033[38;5;51m6. \033[38;5;168m花香正气水  \033[38;5;212m{discount[6]}\033[0m₿/盒\033[39;33m")
    print (f"|\033[38;5;51m7. \033[38;5;168m布落芬  \033[38;5;212m{discount[7]}\033[0m₿/盒\033[39;33m")
    print (f"|\033[38;5;51m8. \033[38;5;168m蒙脱石莎  \033[38;5;212m{discount[8]}\033[0m₿/盒\033[39;33m")
    print (f"|\033[38;5;51m9. \033[38;5;168m急速救心丸  \033[38;5;212m{discount[9]}\033[0m₿/盒\033[39;33m")
    print (f"|\033[38;5;51m10. \033[38;5;160m医疗套装包  \033[38;5;212m{discount[10]}\033[0m₿/包\033[39;33m")
    print ("|---------------------------------------\033[0m")
    return discount, {
            1: 'OK绷', 2: '绷带', 3: '碘液', 4: '75%酒精', 5: '333感冒灵',
            6: '花香正气水', 7: '布落芬', 8: '蒙脱石莎', 9: '急速救心丸', 10: '医疗套装包'}, {
            1: '个', 2: '卷', 3: '瓶', 4: '瓶', 5: '盒', 
            6: '盒', 7: '盒', 8: '盒', 9: '盒', 10: '包'}, {
            1: 2, 2: 7, 3: 12, 4: 15, 5: 15, 
            6: 20, 7: 22, 8: 30, 9: 40, 10: 78}
# ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
def Shop5 (discount_num):
    if (5 in discount_num):
        discount = {1: 1, 2: 5, 3: 5, 4: 12, 5: 15, 
                    6: 24, 7: 35, 8: 44, 9: 120, 10: 450}
        print ("折扣日！")
    else :
        discount = {1: 3, 2: 10, 3: 10, 4: 18, 5: 20, 
                    6: 27, 7: 40, 8: 50, 9: 150, 10: 500}
    print ("\033[39;33m|---------------------------------------")
    print (f"|\033[38;5;51m1. \033[38;5;29m纺织针  \033[38;5;212m{discount[1]}\033[0m₿/包\033[39;33m")
    print (f"|\033[38;5;51m2. \033[38;5;29m剪刀  \033[38;5;212m{discount[2]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m3. \033[38;5;29m卷尺  \033[38;5;212m{discount[3]}\033[0m₿/条\033[39;33m")
    print (f"|\033[38;5;51m4. \033[38;5;166m棉布  \033[38;5;212m{discount[4]}\033[0m₿/包\033[39;33m")
    print (f"|\033[38;5;51m5. \033[38;5;29m五彩逢衣线  \033[38;5;212m{discount[5]}\033[0m₿/盒\033[39;33m")
    print (f"|\033[38;5;51m6. \033[38;5;166m丝绸  \033[38;5;212m{discount[6]}\033[0m₿/m²\033[39;33m")
    print (f"|\033[38;5;51m7. \033[38;5;166m麻布  \033[38;5;212m{discount[7]}\033[0m₿/m²\033[39;33m")
    print (f"|\033[38;5;51m8. \033[38;5;166m皮革  \033[38;5;212m{discount[8]}\033[0m₿/m²\033[39;33m")
    print (f"|\033[38;5;51m9. \033[38;5;29m编制套装包  \033[38;5;212m{discount[9]}\033[0m₿/包\033[39;33m")
    print (f"|\033[38;5;51m10. \033[38;5;96m缝纫机  \033[38;5;212m{discount[10]}\033[0m₿/个\033[39;33m")
    print ("|---------------------------------------\033[0m")
    return discount, {
            1: '纺织针', 2: '剪刀', 3: '卷尺', 4: '棉布', 5: '五彩缝衣线',
            6: '丝绸', 7: '麻布', 8: '皮革', 9: '编制套装包', 10: '缝纫机'}, {
            1: '包', 2: '个', 3: '条', 4: '包', 5: '盒', 
            6: 'm²', 7: 'm²', 8: 'm²', 9: '包', 10: '个'}, {
            1: 3, 2: 10, 3: 10, 4: 18, 5: 20, 
            6: 27, 7: 40, 8: 50, 9: 150, 10: 500}
# ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
def Shop6 (discount_num):
    if (6 in discount_num):
        discount = {1: 45, 2: 60, 3: 99, 4: 169, 5: 189, 
                    6: 309, 7: 428, 8: 699, 9: 1579, 10: 1699}
        print ("折扣日！")
    else :
        discount = {1: 50, 2: 70, 3: 119, 4: 199, 5: 219, 
                    6: 359, 7: 488, 8: 799, 9: 1699, 10: 1899}
    print ("\033[39;33m|---------------------------------------")
    print (f"|\033[38;5;51m1. \033[38;5;21m小凳子  \033[38;5;212m{discount[1]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m2. \033[38;5;21m椅子 \033[38;5;212m{discount[2]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m3. \033[38;5;21m转椅  \033[38;5;212m{discount[3]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m4. \033[38;5;61m矮桌  \033[38;5;212m{discount[4]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m5. \033[38;5;122m床头柜  \033[38;5;212m{discount[5]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m6. \033[38;5;61m木桌  \033[38;5;212m{discount[6]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m7. \033[38;5;145m马桶  \033[38;5;212m{discount[7]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m8. \033[38;5;122m衣柜  \033[38;5;212m{discount[8]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m9. \033[38;5;21m沙发  \033[38;5;212m{discount[9]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m10. \033[38;5;39m洗衣机  \033[38;5;212m{discount[10]}\033[0m₿/个\033[39;33m")
    print ("|---------------------------------------\033[0m")
    return discount, {
            1: '小凳子', 2: '椅子', 3: '转椅', 4: '矮桌', 5: '床头柜',
            6: '木桌', 7: '马桶', 8: '衣柜', 9: '沙发', 10: '洗衣机'}, {
            1: '个', 2: '个', 3: '个', 4: '个', 5: '个', 
            6: '个', 7: '个', 8: '个', 9: '个', 10: '个'}, {
            1: 50, 2: 70, 3: 119, 4: 199, 5: 219, 
            6: 359, 7: 488, 8: 799, 9: 1699, 10: 1899}
# ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————         
def Shop7 (discount_num):
    if (7 in discount_num):
        discount = {1: 3, 2: 3, 3: 3, 4: 4, 5: 4, 
                    6: 5, 7: 5, 8: 9, 9: 28, 10: 40}
        print ("折扣日！")
    else :
        discount = {1: 5, 2: 5, 3: 5, 4: 5, 5: 5, 
                    6: 8, 7: 9, 8: 12, 9: 35, 10: 50}
    print ("\033[39;33m|---------------------------------------")
    print (f"|\033[38;5;51m1. \033[38;5;250m卫生纸  \033[38;5;212m{discount[1]}\033[0m₿/卷\033[39;33m")
    print (f"|\033[38;5;51m2. \033[38;5;250m铅笔  \033[38;5;212m{discount[2]}\033[0m₿/盒\033[39;33m")
    print (f"|\033[38;5;51m3. \033[38;5;250m橡皮  \033[38;5;212m{discount[3]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m4. \033[38;5;24m可乐  \033[38;5;212m{discount[4]}\033[0m₿/瓶\033[39;33m")
    print (f"|\033[38;5;51m5. \033[38;5;24m雪碧  \033[38;5;212m{discount[5]}\033[0m₿/瓶\033[39;33m")
    print (f"|\033[38;5;51m6. \033[38;5;160m方便面  \033[38;5;212m{discount[6]}\033[0m₿/桶\033[39;33m")
    print (f"|\033[38;5;51m7. \033[38;5;250m尺子  \033[38;5;212m{discount[7]}\033[0m₿/套\033[39;33m")
    print (f"|\033[38;5;51m8. \033[38;5;160m薯片  \033[38;5;212m{discount[8]}\033[0m₿/包\033[39;33m")
    print (f"|\033[38;5;51m9. \033[38;5;102m扫把  \033[38;5;212m{discount[9]}\033[0m₿/把\033[39;33m")
    print (f"|\033[38;5;51m10. \033[38;5;102m拖把  \033[38;5;212m{discount[10]}\033[0m₿/把\033[39;33m")
    print ("---------------------------------------\033[0m")
    return discount, {
            1: '卫生纸', 2: '铅笔', 3: '橡皮', 4: '可乐', 5: '雪碧',
            6: '方便面', 7: '尺子', 8: '薯片', 9: '扫把', 10: '拖把'}, {
            1: '卷', 2: '盒', 3: '个', 4: '瓶', 5: '瓶', 
            6: '桶', 7: '套', 8: '包', 9: '把', 10: '把'}, {
            1: 5, 2: 5, 3: 5, 4: 5, 5: 5, 
            6: 8, 7: 9, 8: 12, 9: 35, 10: 50}
# ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
def Shop8 (discount_num):
    if (8 in discount_num):
        discount = {1: 5, 2: 5, 3: 5, 4: 6, 5: 9, 
                    6: 10, 7: 13, 8: 30, 9: 43, 10: 60}
        print ("折扣日！")
    else :
        discount = {1: 10, 2: 10, 3: 11, 4: 12, 5: 18, 
                    6: 20, 7: 25, 8: 45, 9: 53, 10: 80}
    print ("\033[39;33m|---------------------------------------")
    print (f"|\033[38;5;51m1. \033[38;5;208m黄梨  \033[38;5;212m{discount[1]}\033[0m₿/斤\033[39;33m")
    print (f"|\033[38;5;51m2. \033[38;5;208m菠萝  \033[38;5;212m{discount[2]}\033[0m₿/斤\033[39;33m")
    print (f"|\033[38;5;51m3. \033[39;31m苹果  \033[38;5;212m{discount[3]}\033[0m₿/斤\033[39;33m")
    print (f"|\033[38;5;51m4. \033[38;5;208m香蕉  \033[38;5;212m{discount[4]}\033[0m₿/斤\033[39;33m")
    print (f"|\033[38;5;51m5. \033[39;34m蓝莓  \033[38;5;212m{discount[5]}\033[0m₿/斤\033[39;33m")
    print (f"|\033[38;5;51m6. \033[38;5;135m葡萄  \033[38;5;212m{discount[6]}\033[0m₿/斤\033[39;33m")
    print (f"|\033[38;5;51m7. \033[39;31m草莓  \033[38;5;212m{discount[7]}\033[0m₿/斤\033[39;33m")
    print (f"|\033[38;5;51m8. \033[38;5;28m杨桃  \033[38;5;212m{discount[8]}\033[0m₿/斤\033[39;33m")
    print (f"|\033[38;5;51m9. \033[39;32m西瓜  \033[38;5;212m{discount[9]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m10. \033[38;5;208m榴莲  \033[38;5;212m{discount[10]}\033[0m₿/个\033[39;33m")
    print ("|---------------------------------------\033[0m")
    return discount, {
            1: '黄梨', 2: '菠萝', 3: '苹果', 4: '香蕉', 5: '蓝莓',
            6: '葡萄', 7: '草莓', 8: '杨桃', 9: '西瓜', 10: '榴莲'}, {
            1: '斤', 2: '斤', 3: '斤', 4: '斤', 5: '斤', 
            6: '斤', 7: '斤', 8: '斤', 9: '个', 10: '个'}, {
            1: 10, 2: 10, 3: 11, 4: 12, 5: 18, 
            6: 20, 7: 25, 8: 45, 9: 53, 10: 80}
# ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
def Shop9 (discount_num):
    if (9 in discount_num):
        discount = {1: 15, 2: 30, 3: 45, 4: 69, 5: 109, 
                    6: 139, 7: 169, 8: 229, 9: 1350, 10: 1900}
        print ("折扣日！")
    else :
        discount = {1: 20, 2: 35, 3: 55, 4: 88, 5: 120, 
                    6: 150, 7: 199, 8: 259, 9: 1500, 10: 2100}
    print ("\033[39;33m|---------------------------------------")
    print (f"|\033[38;5;51m1. \033[39;94m充电线  \033[38;5;212m{discount[1]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m2. \033[39;94m充电器  \033[38;5;212m{discount[2]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m3. \033[39;95m插排  \033[38;5;212m{discount[3]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m4. \033[39;34m鼠标  \033[38;5;212m{discount[4]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m5. \033[39;34m键盘  \033[38;5;212m{discount[5]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m6. \033[39;34m耳机  \033[38;5;212m{discount[6]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m7. \033[39;34m音响  \033[38;5;212m{discount[7]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m8. \033[39;34m屏幕  \033[38;5;212m{discount[8]}\033[0m₿/个\033[39;33m")
    print (f"|\033[38;5;51m9. \033[39;32mGPU  \033[38;5;212m{discount[9]}\033[0m₿/块\033[39;33m")
    print (f"|\033[38;5;51m10. \033[39;32mCPU \033[38;5;212m{discount[10]}\033[0m₿/块\033[39;33m")
    print ("|---------------------------------------\033[0m")
    return discount, {
            1: '充电器', 2: '充电线', 3: '插排', 4: '鼠标', 5: '键盘',
            6: '耳机', 7: '音响', 8: '屏幕', 9: 'GPU', 10: 'CPU'}, {
            1: '个', 2: '个', 3: '个', 4: '个', 5: '个', 
            6: '个', 7: '个', 8: '个', 9: '块', 10: '块'}, {
            1: 20, 2: 35, 3: 55, 4: 88, 5: 120, 
            6: 150, 7: 199, 8: 259, 9: 1500, 10: 2100}
# ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
def Shop10 (): # 这个店没打折
    print ("\033[39;33m|---------------------------------------")
    print ("|\033[38;5;51m1. \033[39;31m玻璃  \033[38;5;212m22\033[0m₿/m²\033[39;33m")
    print ("|\033[38;5;51m2. \033[39;31m陶瓷  \033[38;5;212m25\033[0m₿/m²\033[39;33m")
    print ("|\033[38;5;51m3. \033[39;32m石膏板  \033[38;5;212m228\033[0m₿/块\033[39;33m")
    print ("|\033[38;5;51m4. \033[39;32m保温板  \033[38;5;212m488\033[0m₿/块\033[39;33m")
    print ("|\033[38;5;51m5. \033[39;34m防腐木材  \033[38;5;212m450\033[0m₿/根\033[39;33m")
    print ("|\033[38;5;51m6. \033[39;35m水泥  \033[38;5;212m490\033[0m₿/袋\033[39;33m")
    print ("|\033[38;5;51m7. \033[39;34m高端木材  \033[38;5;212m650\033[0m₿/根\033[39;33m")
    print ("|\033[38;5;51m8. \033[39;31m防水涂料  \033[38;5;212m1290\033[0m₿/桶\033[39;33m")
    print ("|\033[38;5;51m9. \033[39;35m红砖  \033[38;5;212m3600\033[0m₿/千块\033[39;33m")
    print ("|\033[38;5;51m10. \033[39;35m钢筋  \033[38;5;212m4880\033[0m₿/吨\033[39;33m")
    print ("|---------------------------------------\033[0m")
    return {1: 22, 2: 25, 3: 228, 4: 488, 5: 450, 
            6: 490, 7: 650, 8: 1290, 9: 3600, 10: 4880}, {
            1: '玻璃', 2: '陶瓷', 3: '石膏板', 4: '保温板', 5: '防腐木材',
            6: '水泥', 7: '高端木材', 8: '防水涂料', 9: '红砖', 10: '钢筋'}, {
            1: 'm²', 2: 'm²', 3: '块', 4: '块', 5: '根', 
            6: '袋', 7: '根', 8: '桶', 9: '千块', 10: '吨'}, {
            1: 22, 2: 25, 3: 228, 4: 488, 5: 450, 
            6: 490, 7: 650, 8: 1290, 9: 3600, 10: 4880}
    
# 调试
# ChosShop ('B', 1, [1, 2, 3], {1: 1})